package com.scbo.activity;

import com.scbo.main.R;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class ChoseVsActivity extends Activity implements OnClickListener {

	private int mFirstChoice;
	public static int TvsT = 1;
	public static int TvsP = 2;
	public static int TvsZ = 3;
	public static int PvsT = 4;
	public static int PvsP = 5;
	public static int PvsZ = 6;
	public static int ZvsT = 7;
	public static int ZvsP = 8;
	public static int ZvsZ = 9;
	public static int StandardBuilds = 1;
	public static int MarcoBuilds = 2;
	public static int AggressiveBuilds = 3;
	public static int AllInBuilds = 4;

	public TextView tvRaceVs = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// remove title bar
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);

		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_protoss);

		setUp();

	}

	private void setUp() {
		Bundle extra = getIntent().getExtras();
		mFirstChoice = extra.getInt("firstChoice");
		tvRaceVs = (TextView) findViewById(R.id.tv_racevs);
		if (mFirstChoice == MainActivity.TERRAN_CHOICE) {
			tvRaceVs.setText("Terran");
		} else if (mFirstChoice == MainActivity.PROTOSS_CHOICE) {
			tvRaceVs.setText("Protoss");
		} else if (mFirstChoice == MainActivity.ZERG_CHOICE) {
			tvRaceVs.setText("Zerg");
		}
	}

	@Override
	public void onClick(View v) {
		Intent i = null;
		switch (v.getId()) {
		case R.id.btn_vsP:
			if (mFirstChoice == MainActivity.TERRAN_CHOICE) {
				i = new Intent(this, ListBuildOrderActivity.class);
				i.putExtra("secondChoice", TvsP);
				startActivity(i);
			} else if (mFirstChoice == MainActivity.PROTOSS_CHOICE) {
				i = new Intent(this, ListBuildOrderActivity.class);
				i.putExtra("secondChoice", PvsP);
				startActivity(i);
			} else if (mFirstChoice == MainActivity.ZERG_CHOICE) {
				i = new Intent(this, ListBuildOrderActivity.class);
				i.putExtra("secondChoice", ZvsP);
				startActivity(i);
			}
			break;
		case R.id.btn_vsT:
			if (mFirstChoice == MainActivity.TERRAN_CHOICE) {
				i = new Intent(this, ListBuildOrderActivity.class);
				i.putExtra("secondChoice", TvsT);
				startActivity(i);
			} else if (mFirstChoice == MainActivity.PROTOSS_CHOICE) {
				i = new Intent(this, ListBuildOrderActivity.class);
				i.putExtra("secondChoice", PvsT);
				startActivity(i);
			} else if (mFirstChoice == MainActivity.ZERG_CHOICE) {
				i = new Intent(this, ListBuildOrderActivity.class);
				i.putExtra("secondChoice", ZvsT);
				startActivity(i);
			}
			break;
		case R.id.btn_vsZ:
			if (mFirstChoice == MainActivity.TERRAN_CHOICE) {
				i = new Intent(this, ListBuildOrderActivity.class);
				i.putExtra("secondChoice", TvsZ);
				startActivity(i);
			} else if (mFirstChoice == MainActivity.PROTOSS_CHOICE) {
				i = new Intent(this, ListBuildOrderActivity.class);
				i.putExtra("secondChoice", PvsZ);
				startActivity(i);
			} else if (mFirstChoice == MainActivity.ZERG_CHOICE) {
				i = new Intent(this, ListBuildOrderActivity.class);
				i.putExtra("secondChoice", ZvsZ);
				startActivity(i);
			}
			break;

		default:
			break;
		}
	}

}
